package com.evil.application.pojo.dto.form.control.code;

import com.alibaba.fastjson.JSON;
import com.evil.application.pojo.dto.form.control.code.config.TabsConfigDTO;
import com.evil.application.pojo.entity.ApplicationFormControl;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 标签页控件-表单控件实体
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class TabsControlDTO extends ControlDTO {

    public static final String[] ignoreProperties = new String[]{"tabsConfig"};

    private List<TabsConfigDTO> tabsConfig;

    public TabsControlDTO(ApplicationFormControl applicationFormControl) {
        super(applicationFormControl, ignoreProperties);
        this.tabsConfig = JSON.parseArray(applicationFormControl.getTabsConfig(), TabsConfigDTO.class);
    }
}
